package com.dr.cmdb.query.neo4jdao;

import com.dr.cmdb.query.neo4jdao.relation.CiItemAssociation;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ProjectName: cmdb
 * @Package: com.dr.cmdb.application.neo4jdao
 * @Description: java类作用描述
 * @Author: duanrui
 * @CreateDate: 2021/4/2 15:20
 * @Version: 1.0
 * <p>
 * Copyright: Copyright (c) 2021
 */
@Repository
public interface CiItemAssociationRepository extends Neo4jRepository<CiItemAssociation,Long> {
    CiItemAssociation getCiItemAssociationByName(String name);

    @Query("MATCH p= (s:CiItemEntity{name:$name})-[*1..3]->(t:CiItemEntity) return p")
    List<CiItemAssociation> getByName(String name);
}
